package exercise;

import java.util.*;

/**
 * ${DESCRIPTION}
 *
 * @author luoyalan
 * @date 2018/11/26
 */
public class ListDemo {
    public static void main(String[] args) {
        //LinkedList<String> stringList = new LinkedList<String>();
        //stringList.addAll(Arrays.asList("1", "2", "3", "4", "5"));
        //System.out.println(stringList);
        //System.out.println(stringList.getFirst());

        Map<Integer, String> map = new HashMap<>();
        map.put(1, "A");
        map.put(2, "B");
        map.put(3, "C");
        System.out.println(Arrays.toString(mapToArray(map)));
    }

    public static String[] mapToArray(Map<Integer, String> map) {
        Collection<String> values = map.values();
        return values.toArray(new String[values.size()]);
    }
}
